//
//  SongRecommendTableViewCell.m
//  UI_22_Homework_QQ音乐界面_阿里星球界面
//
//  Created by li cheng on 16/8/13.
//  Copyright © 2016年 li cheng. All rights reserved.
//

#import "SongRecommendTableViewCell.h"
#import "SongRecommenCollectionViewCell.m"
@interface SongRecommendTableViewCell()<UICollectionViewDelegate, UICollectionViewDataSource>
@property (nonatomic, strong) UICollectionView *collectionView;
@property (nonatomic, strong) UICollectionViewFlowLayout *layout;
@end
@implementation SongRecommendTableViewCell
#pragma mark - 初始化
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _layout = [[UICollectionViewFlowLayout alloc] init];
        _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:_layout];
        [self.contentView addSubview:_collectionView];
        _collectionView.delegate = self;
        _collectionView.dataSource = self;
        [_collectionView registerClass:[SongRecommenCollectionViewCell class] forCellWithReuseIdentifier:@"SongRecommendCollectionViewCell"];
    }
    return self;
}
#pragma mark - item 的个数
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
    return 2;
}
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
    SongRecommenCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"SongRecommendCollectionViewCell" forIndexPath:indexPath];
    cell.backgroundColor = [UIColor magentaColor];
    return cell;
}



#pragma mark - 其他
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end

